public class Main {
    public static void main(String[] args) {
        // 创建两个学生对象并调用其方法
        Student student1 = new Student("Alice", 20, "123456", 3.5, "Computer Science");
        student1.introduce(); // 方法1：自我介绍
        student1.displayGpa(); // 方法2：展示GPA

        Student student2 = new Student("Bob", 22, "234567", 3.7, "Mathematics");
        student2.introduce(); // 方法1：自我介绍
        student2.displayGpa(); // 方法2：展示GPA

        // 创建两个教师对象并调用其方法
        Teacher teacher1 = new Teacher("Charlie", 5, "Computer Science", "Stanford University", false);
        teacher1.teachSubject("Data Structures"); // 方法1：教授课程
        teacher1.displayYearsExperience(); // 方法2：展示教学经验

        Teacher teacher2 = new Teacher("David", 7, "Physics", "Harvard University", true);
        teacher2.teachSubject("Mechanics"); // 方法1：教授课程
        teacher2.displayYearsExperience(); // 方法2：展示教学经验
    }
}

